<template>
	<view class="main-box">
		<view class="no-car-box" v-if="platex==''">
			<image class="icon" mode="widthFix" src="/static/images/my_car/car-icon.png"></image>
			<view class="note1">你还没有车辆</view>
			<view class="note2">点按钮立即添加车辆</view>
			<view class="btn" @tap="add">+添加车辆</view>
		</view>
		
		<view class="culmo" v-if="platex!=''">
			<view class="platex d_f j_c_s_b">
				<view class="d_f  a_i_c" @click="shows = true">
					<view class="trans">
						{{platex}}
					</view>
					<u-select  @confirm="confirm" mode=single-column :list="listx"></u-select>
			
					<image src="../../static/select.png" mode="widthFix" class="select" v-if="listx.length>0"></image>
				</view>
				<view class="d_f  a_i_c" @tap="add()">
					<image src="../../static/edit.png" mode="widthFix" class="edit"></image>
					<view class="change">
						更改车牌
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
platex:"",
listx:[]
			};
		},
		methods:{
			add(){
				uni.navigateTo({
					url: '/pages/my_car/plate'
				})
			}
		},
		onShow(){
			if (uni.getStorageSync('listx')) {
				console.log(uni.getStorageSync('listx')[0].label)
			if(uni.getStorageSync('listx')[0].label.value){
				this.platex = uni.getStorageSync('listx')[0].label.value
			}else{
				this.platex = uni.getStorageSync('listx')[0].label
			}
				
				

			}
		}
	}
</script>

<style lang="scss">
	.change {
		margin-left: 8rpx;
		color: #8F939E;
		font-size: 27rpx;
	}
	.culmo{
		
		width: 692rpx;
		height: 169rpx;
		background: #FFFFFF;
		border-radius: 11rpx;
		margin: 0 auto;
		padding: 26rpx;
	}
	.edit {
		width: 30rpx;
		height: 27rpx;
	}
	.platex {
		height: 74rpx;
		border-radius: 35rpx 35rpx 0rpx 0rpx;
		
	}
	
	.main-box {
		background-color: #f1f4f9;
		min-height: 100vh;
		padding: 24rpx;
		
		
		
	}

	.no-car-box {
		width: 90%;
		left: 5%;
		top: 30%;
		position: absolute;
		text-align: center;

		.icon {
			width: 205rpx;
			height: auto;
		}

		.note1 {
			font-family: PingFang-SC-Heavy;
			font-size: 24rpx;
			letter-spacing: 1rpx;
			color: #727272;
			margin-top: 47rpx;
			text-align: center;
			font-weight: 600;
		}

		.note2 {
			font-family: PingFang-SC-Regular;
			font-size: 24rpx;
			letter-spacing: 1rpx;
			color: #727272;
			margin-top: 27rpx;
			text-align: center;
		}

		.btn {
			width: 276rpx;
			height: 76rpx;
			line-height: 76rpx;
			background-color: #f8f8f8;
			border-radius: 38rpx;
			border: solid 2rpx #6086cf;
			text-align: center;

			font-family: PingFang-SC-Medium;
			font-size: 28rpx;
			letter-spacing: 1rpx;
			color: #4f88e1;
			margin: 30rpx auto 0;
		}
	}
</style>